package org.kzwl.comm.pojo.dto.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;

@Data
@ApiModel("用户信息")
public class UserTokenDTO {

    @ApiModelProperty("用户id")
    private Integer cuUserId;

    @ApiModelProperty("用户名")
    private String cuUsername;

    @ApiModelProperty("手机号")
    private String cuUserPhone;

    @ApiModelProperty("头像")
    private String cuUserImage;

    @ApiModelProperty("已看x本书")
    private Integer cuUserReadCount;

    @ApiModelProperty("已看时长")
    private BigDecimal cuUserReadHour;

    public void setCuUserReadHour(BigDecimal cuUserReadHour) {
        if (cuUserReadHour==null || cuUserReadHour.compareTo(new BigDecimal(0))==0){
            this.cuUserReadHour = cuUserReadHour;
        }else{
            this.cuUserReadHour = cuUserReadHour.divide(new BigDecimal(60),2, BigDecimal.ROUND_HALF_UP);
        }
    }

    @ApiModelProperty("今日看书时长")
    private Integer cuUserDayMinute;

    @ApiModelProperty("今日最后一次看书的日期")
    private LocalDateTime cuUserMinuteLast;

    @ApiModelProperty("连续看书天数")
    private Integer cuUserReadDay;

    @ApiModelProperty("是否拥有直播权限 0否1是")
    private Integer cuUserIsLive;
//
//    @ApiModelProperty("轮播图")
//    List<String> banners = new ArrayList<>();

}
